package com.education.business.mapper.system;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.education.model.entity.SystemEmailLog;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface SystemEmailLogMapper extends BaseMapper<SystemEmailLog> {

    // 自定义查询方法
    List<SystemEmailLog> selectByRecipient(String recipient);

    List<SystemEmailLog> selectByStatus(String status);

    List<SystemEmailLog> selectByTimeRange(
            @Param("startTime") LocalDateTime startTime,
            @Param("endTime") LocalDateTime endTime);

    // 添加这三个方法
    Integer countByTimeRange(
            @Param("startTime") LocalDateTime startTime,
            @Param("endTime") LocalDateTime endTime);

    Integer countByStatusAndTimeRange(
            @Param("status") String status,
            @Param("startTime") LocalDateTime startTime,
            @Param("endTime") LocalDateTime endTime);
}